package com.yunyu.demo;

import android.content.Intent;
import android.os.Bundle;

import androidx.appcompat.app.AppCompatActivity;

import com.yunyu.demo.video.VideoActivity;

public class MainActivity extends AppCompatActivity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.main_list);

        initClick();

        //权限检测
        PermissionHelper.Companion.checkPermission(this, new PermissionHelper.Companion.PermissionCb() {
            @Override
            public void onSubscribe(boolean permission) {
                if (!permission){
                    finish();
                }
            }
        });
    }

    void initClick(){
        findViewById(R.id.btn_camera_buffer).setOnClickListener(v -> {
            startActivity(new Intent(this, CameraBufferActivity.class));
        });

        findViewById(R.id.btn_camera_window).setOnClickListener(v -> {
            startActivity(new Intent(this, CameraWindowActivity.class));
        });

        findViewById(R.id.btn_camera_agora).setOnClickListener(v -> {
            startActivity(new Intent(this, CameraBufferSyncActivity.class));
        });

        findViewById(R.id.btn_video_edit).setOnClickListener(v -> {
            startActivity(new Intent(this, VideoActivity.class));
        });
    }
}
